﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using GameLibrary;
using GameLibrary.Unit;
using GameLibrary.Settlement;
using GameLibrary.Tile;

namespace UserInterface.Helpers
{

    public static class InformationProvider
    {

        #region settlement
                private static List<SettlementInfomation> PrepareSettlementInfo(IEnumerable<SettlementInfo> infoList)
        {
            List<SettlementInfomation> settlementInfomationForDateGrid = new List<SettlementInfomation>();
            foreach (SettlementInfo info in infoList)
                settlementInfomationForDateGrid.Add(new SettlementInfomation(info));
            return settlementInfomationForDateGrid;
        }

        public static IEnumerable<SettlementInfomation> GetSettlementInformations(IEnumerable<SettlementInfo> settlementInfoList)
        {
            return PrepareSettlementInfo(settlementInfoList);
        }

        public static SettlementInfomation GetSettlementInformation(SettlementInfo settlement)
        {
            return new SettlementInfomation(settlement);
        } 

        #endregion

        #region unit

        private static List<UnitInfomation> PrepareUnitInfo(IEnumerable<UnitInfo> infoList)
        {
            List<UnitInfomation> unitInformationForDataGrid = new List<UnitInfomation>();
            foreach (UnitInfo info in infoList)
                unitInformationForDataGrid.Add(new UnitInfomation(info));
            return unitInformationForDataGrid;
        }

        public static IEnumerable<UnitInfomation> GetUnitInformations(IEnumerable<UnitInfo> unitInfoList)
        {
            return PrepareUnitInfo(unitInfoList);
        }

        public static UnitInfomation GetUnitInformation(UnitInfo unit)
        {
            return new UnitInfomation(unit);
        }
        #endregion

        #region relationship

        public static RelationshipInfomation PrepareRelationshipInformation(
            Dictionary<uint, Dictionary<uint, DiplomaticRelationshipType>> relationships)
        {
            return new RelationshipInfomation(relationships);
        }

        #endregion

        #region tile

        public static TileInformation GetTileInformation(TileType tile)
        {
            return new TileInformation(tile);
        }
        #endregion

    }
}
